<?php if(!empty($products)) { ?>
<div class="box">
    
    <h3><i class="fa fa-star"></i><?php echo $category; ?></h3>

    <div class="grid">
        <div class="row">
        <?php foreach($products as $key => $product){
            if(SLUG_ACTIVE==0){
                $uri = get_base_url() . url_title(trim($product->product_name), 'dash', TRUE) . '-ps' . $product->id;
            }else{
                $uri = get_base_url() . $product->slug;
            }
            $image = is_null($product->image_name) ? base_url().'images/no-image.png' : base_url().'images/products/thumbnails/'.$product->image_name;
            $product_name = limit_text($product->product_name, 50);
            $price = $product->price != 0 ? get_price_in_vnd($product->price) . ' ₫' : get_price_in_vnd($product->price);           
//            $product_unit   = ($product->unit != NULL && $product->unit != '') ? '/' . $product->unit : '';
        ?>
        <div class="col-sm-3 grid_item">
            <div class="thumbnail">
                <a href="<?php echo $uri; ?>" title="<?php echo $product->product_name; ?>">
                    <img title="<?php echo $product->product_name; ?>" alt="<?php echo $product->product_name; ?>" src="<?php echo $image; ?>" >
                </a>
                <div class="caption">
                    <p class="grid_title"><a href="<?php echo $uri; ?>" title="<?php echo $product->product_name; ?>"><?php echo $product_name; ?></a></p>
<!--                    <p class="grid_price">
                        <strong><?php // echo $price; ?></strong><?php // echo ($price<>0)?$product_unit:'';?>
                    </p>-->
                    <p><strong>Hãng: </strong><?php echo $product->trademark_name; ?></p>
                    <p><strong>Xuất xứ: </strong><?php echo $product->origin_name; ?></p>
                </div>
            </div>
        </div>
        <?php } ?>
        </div>
    </div>
    
</div>
<?php } ?>